<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>物流状态查询</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'/>
    <%@include file="/WEB-INF/pages/common/taglib.jsp" %>
    <%@include file="/WEB-INF/pages/common/common.jsp" %>
</head>
<body class='contrast-red'>
<div class="content content_frame">
    <h3 class="mainTitle"><img src="${basePath}/images/icon2.png"/>物流状态查询</h3>
    </br>
    <ul class="contentNav dib-wrap">
        <li class="dib" id="btnSearch" defaultkey='13' onclick="$._options._query('corptable','queryOrderList')">
            <a><i class='fa fa-search'></i>&nbsp;&nbsp;查&nbsp;询 </a>
        </li>
        <li class="dib ">
            <a onclick="ClearAllInput('SearchTable')">
                <i class='fa fa-refresh'></i>&nbsp;&nbsp;重&nbsp;置 </a>
        </li>
    </ul>
    <br/>
    <table id="SearchTable" width="100%" class="table1">
        <tr>
            <td style="width: 50%;">
                <table width="100%" border="0" cellspacing="10" cellpadding="0">
                    <tr>
                        <td style="width: 25%;">
                            <table width="100%" border="0" cellspacing="10" cellpadding="0">
                                <tr>
                                    <td class="titleCss">
                                        提运单号
                                    </td>
                                    <td class="tdCss">
                                        <input type="text" datafield="SearchTable.billNo"/>
                                    </td>

                                </tr>
                            </table>
                        </td><td style="width: 25%;">
                            <table width="100%" border="0" cellspacing="10" cellpadding="0">
                                <tr>
                                    <td class="titleCss">
                                        运单编号
                                    </td>
                                    <td class="tdCss">
                                        <input type="text" datafield="SearchTable.logisticsNo"/>
                                    </td>

                                </tr>
                            </table>
                        </td>
                    <td style="width: 25%;">
                        <table width="100%" border="0" cellspacing="10" cellpadding="0">
                            <tr>
                                <td class="titleCss">
                                    收货人姓名
                                </td>
                                <td class="tdCss">
                                    <input type="text" datafield="SearchTable.consignee"/>
                                </td>

                            </tr>
                        </table>
                    </td>
                    <td style="width: 25%;">
                        <table width="100%" border="0" cellspacing="10" cellpadding="0">
                            <tr>
                                <td class="titleCss">
                                    收货人电话
                                </td>
                                <td class="tdCss">
                                    <input type="text" datafield="SearchTable.consigneePhone"/>
                                </td>

                            </tr>
                        </table>
                    </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <div class="cl"></div>
    <br/>
    <table id="corptable">
    </table>
    <div id="corptablePage">
    </div>
</div>
<script type="text/javascript">
    function showStatus(cellvalue) {
        layer.open({
            type: 2,
            title: '物流状态',
            shadeClose: true,
//            shade: false,
            area: ['680px', '400px'],
            content: '${basePath}/logisticsMgn/search/showDetail?logisticsNo=' + cellvalue
        });
    }
    function detail(cellvalue, options, rowObject) {
        return "<a class=\"btn-link\" onclick='showStatus(\"" + cellvalue + "\")'><span style=\"color:#00acec\">" + $.trim(cellvalue || '') + "</sapn></a>";
    }


    $(function () {
        $("#corptable").jqGrid({
            datatype: "json",
            url: "queryOrderList",
            colNames: [
                'id',
                '物流企业代码', '物流企业名称',
                '物流运单编号',
                '提运单号',
                '运费',
                '保价费',
                '毛重',
                '件数',
                '收货人姓名',
                '收货人地址',
                '收货人电话',
                '申报时间'
            ],
            colModel: [
                {name: 'id', index: 'id', key: true, hidden: true},
                {name: 'logisticsCode', index: 'logisticsCode'},
                {name: 'logisticsName', index: 'logisticsName'},
                {name: 'logisticsNo', index: 'logisticsNo', formatter: detail},
                {name: 'billNo', index: 'billNo'},
                {name: 'freight', index: 'freight'},
                {name: 'insuredFee', index: 'insuredFee'},
                {name: 'grossWeight', index: 'grossWeight'},
                {name: 'packNo', index: 'packNo'},
                {name: 'consignee', index: 'consignee'},
                {name: 'consigneeAddr', index: 'consigneeAddr'},
                {name: 'consigneePhone', index: 'consigneePhone'},
                {name: 'appDate', index: 'appDate'}
            ],
            viewrecords: true, // show the current page, data rang and total records on the toolbar
            autowidth: true,
            height: 'auto',
            shrinkToFit: false,
            autoScroll: true,
            rowNum: 10, //每页显示记录数
            rowList: [10, 20, 100], //可调整每页显示的记录数
            rownumbers: true,
            rownumWidth: 35,
            width: $('body').width(),
            pager: "#corptablePage", //分页工具栏
            sortname: "appDate",
            sortorder: "desc",
            loadComplete: function () {
                var rowNum = $(this).jqGrid('getGridParam', 'records');
                if (rowNum <= 0) {
                    if ($(this).parent().children('.norecords').length == 0)
                        $(this).parent().append("<div class=\"norecords\">暂无数据！</div>");
                    $(this).parent().children('.norecords').show();
                }
                else {//如果存在记录，则隐藏提示信息。
                    $(this).parent().children('.norecords').hide();
                }
                $("#corptable").setGridWidth($(window).width() * 0.98);
                $(".ui-jqgrid tr.ui-row-ltr td").css('text-align', 'center');
            }
        });
    });
</script>
</body>
</html>
